package com.eugenes.concurrency.callables;

import java.util.concurrent.Callable;

public class SinAdder implements Callable<Double> {

    private final int from;
    private final int to;

    public SinAdder(int from, int to) {
        this.from = from;
        this.to = to;
    }

    @Override
    public Double call() {
        double result = 0.;
        for (int i=from; i<=to; ++i) {
            result += Math.sin(i);
        }
        return result;
    }
}
